<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h5 class="modal-title">工步设置</h5>
</div>

<div>
    <div class="main-body">
        <table id="dataTable_process" data-url="/diagnostic/process_data" data-page-list=[]  data-striped="true" data-pagination="true" data-page-size="15" data-cache="false">

        </table>
    </div>

    <div class="modal-footer">
        <button type="submit" class="btn btn-primary">确定</button>
    </div>
</div>

<style>
    .modal-footer{
        text-align:center!important;
    }
</style>


<script>

    //table字段
    var dataFormat = [{
        title: '序号',
        align: 'center',
        formatter : function (value, row, index) {
            return index + 1;
        }
    },{
        field: 'operate',
        title: '操作',
        align: 'center',
        formatter : formatOperate
    },{
        field: 'duration',
        title: '时长',
        align: 'center',
        formatter : formatDuration
    },{
        field: 'id',
        align: 'center',
        title: '操作',
        formatter : formatOperateId
    }];

    //格式化 操作
    function formatOperate(value, row, index) {

        var html =  '<select>' +
                        '<option value="1">恒流充电</option>' +
                        '<option value="2">恒流放电</option>' +
                        '<option value="3">静置</option>' +
                    '</select>';

        return [html].join('');
    }

    //格式化 时长
    function formatDuration(value, row, index) {

        var html = '<input type="text" name="duration" value="' + value + '"/>';
        return [html].join('');
    }
    
    function formatOperateId(value, row, index) {

        var html = '';

        html += '<img src="/image/552cc4865dec1_32_up.png"  alt="上移一步" title="上移一步" style="height:30px;width: 30px;"/>';
        html += '<img src="/image/552cc483ee45a_32_down.png"  alt="下移一步" title="下移一步" style="height:30px;width: 30px;"/>';
        html += '<img src="/image/552cc59fc433f_32_add.png"  alt="添加" title="添加" style="height:30px;width: 30px;"/>';
        html += '<img src="/image/552cc3334ab03_32_delete.png"  alt="删除" title="删除" style="height:30px;width: 30px;"/>';

        return [html].join('');
    }

    getTable(dataFormat, "dataTable_process");
</script>